﻿package src{
	import flash.display.*;
	import flash.events.*;
	import flash.geom.*;
	import flash.net.*;
	import flash.text.*;
	import flash.ui.*;
	import flash.utils.*;


	public final class PP extends Sprite {
		private var config:Object = CP.config;
		public function PP():void {
			draw();
			//
			CP.addEventListener(E.RESIZE,resizeHandler);
		}

		private function draw():void {
			var dx:Number = 20;
			var dy:Number = 5;
			//
			var p1:Sprite = paper(0x999999, 200, 50);
			p1.rotationX = -dx;
			p1.rotationY = -dy;
			addChild(p1);
			
			
			var p2:Sprite = paper(0x999999, 200, 50);
			p2.rotationX = dx;
			p2.rotationY = dy;
			addChild(p2);
			
			var p3:Sprite = paper(0xcccccc, 200, 50);
			p3.rotationX = -90;
			p3.rotationY = dy;
			addChild(p3);
			
			var p4:Sprite = paper(0xcccccc, 200, 50);
			p4.rotationX = 90;
			p4.rotationY = -dy;
			addChild(p4);
			//
			rotationY = 45;
			//rotationZ = -5;
		}
		private function paper(c:Number, w:Number, h:Number):Sprite {
			var p:Sprite = new Sprite();
			with (p.graphics) {
				beginFill(c, 1);
				lineStyle(1, 0x333333, 0.5, true, "none");
				drawTriangles(Vector.<Number>([0,0,w,0,w,h]));
				endFill();
			}
			return p;
		}
		
		//========================================================
		private function resizeHandler(e:E=null):void {

		}

	}
}